﻿using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace Common
{
    public class verificationPassWrod_com
    {
        public static bool PassWord(string p)
        {
            if(p.Length<6||p.Length>16)return false;
            if (Regex.IsMatch(p,@"\W")) return false;
            return true;
        }
        public static string addVerify(Students_MD Students)
        {
            
            if (!Regex.IsMatch(Students.StudentName, @"[\u4e00-\u9fa5]{2,5}"))
            {
             
                return "添加考生信息失败,请检查姓名输入是否正确";
            }
          
            if (!Regex.IsMatch(Students.StudentIdNo, @"^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{4}$"))
            {
           
                return "添加考生信息失败,请检查身份证号格式是否正确";
            }
           
            if (!Regex.IsMatch(Students.PhoneNumber, @"^1[3456789]\d{9}$"))
            {
                return "添加考生信息失败,请检查手机号格式是否正确";
               
            }
            return null;
        }
    }
}
